home *** CD-ROM | disk | FTP | other *** search
- FOR
- Repeats a command for several variables in a batch file.
-
- COMMAND TYPE: Internal (batch) VERSION: 2.0 and up
-
- USE: FOR %%var IN (set) DO command
-
- %%var represents a variable that will be sequentially set to each value in
- set. If the FOR command is used in a batch file, %%var must be used, if
- the FOR command is used at the DOS level, only one % is required.
-
- set contains the actual values that %%var will represent when the command
- is executed. willdcard file specifiers are allowed in set.
-
- command is the DOS command that will be repeated. In the command, %%var
- will be replaced by the value of the variable.
-
- EXAMPLE: FOR %%g IN(*.TXT) DO TYPE %%g
-
- when this command is encountered in a batch file, all files with the
- extension .TXT will be TYPEd (displayed on the screen).
-